home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / TSR / TPPOP18C / FASTPUT.ASM < prev    next >
Assembly Source File  |  1988-12-07  |  2KB  |  95 lines

  1. .MODEL TPASCAL
  2. LOCALS @@
  3.  
  4. .DATA
  5.  
  6. EXTRN CheckSnow:BYTE,textattr:BYTE
  7.  
  8. .CODE
  9.  
  10. PUBLIC fastputvertical,fastputhorizontal
  11.  
  12. SetUp    PROC   NEAR
  13.  
  14.          dec    bx
  15.          mov    ax,bx
  16.          shl    ax,1
  17.          shl    ax,1
  18.          add    ax,bx
  19.          mov    cl,5
  20.          shl    ax,cl       ; multiply row by 160d
  21.  
  22.          dec    dx
  23.          shl    dx,1
  24.          add    ax,dx       ; add col to row
  25.          mov    di,ax
  26.          mov    ah,0Fh      ; get the video mode
  27.          int    10h
  28.          mov    bx,0B800h   ; assume color segment
  29.          cmp    al,7        ; is it mono
  30.          jne    @@01        ; no, keep color segment
  31.          mov    bx,0B000h   ; use mono segment
  32. @@01:
  33.          mov    es,bx
  34.          mov    al,[checksnow]
  35.          mov    bh,[textattr]
  36.          cld
  37.          ret
  38.  
  39. SetUp    ENDP
  40.  
  41. FastPutVertical PROC  NEAR character:BYTE:2,count:WORD,col:WORD,row:WORD
  42.  
  43.          mov    bx,row
  44.          mov    dx,col
  45.          call   setup
  46.          mov    cx,count
  47.          mov    bl,character
  48. ;         mov    bh,[textattr]
  49. ;         mov    al,[checksnow]
  50. ;         cld
  51.          or     al,al
  52.          jz     @@03
  53.          mov    dx,03DAh
  54. @@02:
  55.          in     al,dx
  56.          and    al,9
  57.          cmp    al,9
  58.          jne    @@02
  59. @@03:
  60.          mov    ax,bx
  61. @@04:
  62.          stosw
  63.          add    di,158d       ; adjust for next row
  64.          loop   @@04
  65.          ret
  66.  
  67. FastPutVertical ENDP
  68.  
  69. FastPutHorizontal PROC NEAR character:BYTE:2,count:WORD,col:WORD,row:WORD
  70.  
  71.          mov    bx,row
  72.          mov    dx,col
  73.          call   setup
  74.          mov    cx,count
  75.          mov    bl,character
  76. ;         mov    bh,[textattr]
  77. ;         mov    al,[checksnow]
  78. ;         cld
  79.          or     al,al
  80.          jz     @@03
  81.          mov    dx,03DAh
  82. @@02:
  83.          in     al,dx
  84.          and    al,9
  85.          cmp    al,9
  86.          jne    @@02
  87. @@03:
  88.          mov    ax,bx
  89.          rep    stosw
  90.          ret
  91.  
  92. FastPutHorizontal ENDP
  93.  
  94. END
  95.